<?php 

include './Core/function.php';

// var_dump($_COOKIE);

// if(isset($_COOKIE['username'])){
// 	echo '你已经登录';
// }else{
// 	echo '你没有登录';
// }
// session_start();

// var_dump($_SESSION);

// session_unset();

// session_destroy();

// var_dump($_SESSION);

// exit;

if($_POST){
	$res = array();
	$id = $_POST['id'];
	$res['username']= $_POST['username'];
	$res['info']= $_POST['info'];

	$db = include './db.php';

	$db[$id]=$res;


	$str = var_export($db,True);

	$str = "<?php 
	return  ". $str ." 
	?>";

	file_put_contents('./db.php', $str);

	success('index.php','修改成功');

}else{
	$id = $_GET['id'];

	$db = include './db.php';

	include './Tpl/edit.html';
}


 ?>